<script setup>
import { myTitle } from '../test.js'
const emits = defineEmits(['change'])
const props = defineProps({
  title: {
    type: String
  }
})
const change = () => {
  emits('change', '我是传递的新标题')
}
setTimeout(() => {
  console.log('woshi' + myTitle)
}, 6000)
</script>
<template>
  <div class="space-y-[10px]">
    <div class="text-[red]">我是子组件</div>
    <div v-if="title">
      <div>{{ title }}</div>
      <div class="mt-[10px]">
        <el-button @click="change">改变标题</el-button>
      </div>
    </div>

    <slot></slot>
    <slot name="content"></slot>
  </div>
</template>
